@echo off

REM SHA1 sums of files required
REM 9988723269367fb44ef83f627186a1c88cf7877e decoder.4
REM 30002643d08ed983a6701a7c4b5ee74a2f4a1adb decoder.6
REM 026d8cab07734fa294a5645edbe65a904bcbc302 sinistar.01
REM 423d1e3b0c07333ec582529bc4d0b7baf591820a sinistar.02
REM 5bc03d7249529d827dc60c087e074ab3e4ea7361 sinistar.03
REM 72c0c3d5a5ca87ca4d95fcedaf834206e4633950 sinistar.04
REM 828a89d2ea13d8a362dae708f86bff54cb231887 sinistar.05
REM 703e29e6446856615760a4897c0f5d79cc7bdfb2 sinistar.06
REM bf4e2ada6a59d246218544d822ba5355da925924 sinistar.07
REM 8c7eca656b2c23b0da41a8c7ce51a2735cab85a4 sinistar.08
REM 96e28e4fef98fff2649741a266fa590e0313e3b0 sinistar.09
REM 81802622bee8dbea5c0f08019d87d941dcdbe292 sinistar.10
REM 2f38e572ab9c731e38dfe9bad3cc8222a775c5ea sinistar.11
REM c70c7dd6e88897920d7709a260f27810f66aade1 sinistar.snd
REM 44430cd5c110ec751b0bfb8ae99b26d443350db1 speech.ic4
REM d5d51c550581c9d46ab331dd4fd32541a2ef598e speech.ic5
REM 16fa2a602acbbc182dd96bab113ab18356f3daf0 speech.ic6
REM 442f4f3ccd2e1db2136d2ffb121ea442921f87ca speech.ic7

set rom_path_src=..\roms\sinistar
set rom_path_dst=..\build
set romgen_path=..\tools

mkdir %rom_path_dst%
REM generate RAMB structures for larger ROMS

REM soundcpu - speech ROMs B000-EFFF not connected
REM %romgen_path%\romgen %rom_path_src%\speech.ic4   SND_ROM_0B    12 l r e > %rom_path_dst%\SND_ROM_0B.vhd
REM %romgen_path%\romgen %rom_path_src%\speech.ic5   SND_ROM_0C    12 l r e > %rom_path_dst%\SND_ROM_0C.vhd
REM %romgen_path%\romgen %rom_path_src%\speech.ic6   SND_ROM_0D    12 l r e > %rom_path_dst%\SND_ROM_0D.vhd
REM %romgen_path%\romgen %rom_path_src%\speech.ic7   SND_ROM_0E    12 l r e > %rom_path_dst%\SND_ROM_0E.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.snd SND_ROM_0F    12 l r e > %rom_path_dst%\SND_ROM_0F.vhd

REM decoders
%romgen_path%\romgen %rom_path_src%\decoder.4    DECODER_4      9 a     > %rom_path_dst%\DEC_4.vhd
%romgen_path%\romgen %rom_path_src%\decoder.6    DECODER_6      9 a     > %rom_path_dst%\DEC_6.vhd

REM maincpu - dummy ROM at D000, not used
%romgen_path%\romgen %rom_path_src%\sinistar.10  CPU_ROM_0D    12 l r e > %rom_path_dst%\CPU_ROM_0D.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.10  CPU_ROM_0E    12 l r e > %rom_path_dst%\CPU_ROM_0E.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.11  CPU_ROM_0F    12 l r e > %rom_path_dst%\CPU_ROM_0F.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.01  CPU_ROM_10    12 l r e > %rom_path_dst%\CPU_ROM_10.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.02  CPU_ROM_11    12 l r e > %rom_path_dst%\CPU_ROM_11.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.03  CPU_ROM_12    12 l r e > %rom_path_dst%\CPU_ROM_12.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.04  CPU_ROM_13    12 l r e > %rom_path_dst%\CPU_ROM_13.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.05  CPU_ROM_14    12 l r e > %rom_path_dst%\CPU_ROM_14.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.06  CPU_ROM_15    12 l r e > %rom_path_dst%\CPU_ROM_15.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.07  CPU_ROM_16    12 l r e > %rom_path_dst%\CPU_ROM_16.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.08  CPU_ROM_17    12 l r e > %rom_path_dst%\CPU_ROM_17.vhd
%romgen_path%\romgen %rom_path_src%\sinistar.09  CPU_ROM_18    12 l r e > %rom_path_dst%\CPU_ROM_18.vhd

echo done
pause
